package com.sync.platform.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;

/**
 * Synchronization task log entity
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("sync_task_log")
public class SyncTaskLog extends BaseEntity {

    /**
     * Associated task ID
     */
    @TableField("task_id")
    private Long taskId;

    /**
     * Task name (for convenience)
     */
    @TableField("task_name")
    private String taskName;

    /**
     * Task type (1: database sync, 2: file sync)
     */
    @TableField("task_type")
    private Integer taskType;

    /**
     * Execution start time
     */
    @TableField("start_time")
    private LocalDateTime startTime;

    /**
     * Execution end time
     */
    @TableField("end_time")
    private LocalDateTime endTime;

    /**
     * Execution duration in milliseconds
     */
    @TableField("duration")
    private Long duration;

    /**
     * Execution status (0: failed, 1: successful)
     */
    @TableField("status")
    private Integer status;

    /**
     * For database sync: number of records synchronized For file sync: number
     * of files synchronized
     */
    @TableField("sync_count")
    private Integer syncCount;

    /**
     * Execution message (error details or success summary)
     */
    @TableField("message")
    private String message;

    /**
     * Detailed execution log
     */
    @TableField("detail_log")
    private String detailLog;
}
